//package com.yxl.service.impl;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//import com.common.music.mapper.ChatListMapper;
//import com.common.music.pojo.ChatList;
//import com.common.music.service.ChatListService;
//import com.common.music.vo.ChatListVo;
//import com.common.music.vo.CommentVo;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.time.LocalDateTime;
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Objects;
//import java.util.stream.Collectors;
//
//@Slf4j
//@Service
//public class ChatListServiceImpl extends ServiceImpl<ChatListMapper, ChatList> implements ChatListService {
//
//    @Autowired
//    private ChatListMapper chatListMapper;
//
//    @Override
//    public List<ChatListVo> selectAllByChatFromId(Integer chatFromId) {
//        return chatListMapper.selectAllByChatFromId(chatFromId);
//    }
//
//    @Override
//    public long selectChatListByChatFromIdAndChatToId(ChatList chatList) {
//        chatList.setCreatedSessionTime(LocalDateTime.now());
//        return chatListMapper.selectCount(new QueryWrapper<ChatList>()
//                .eq("chat_from_id",chatList.getChatFromId())
//                .eq("chat_to_id",chatList.getChatToId())) == 0 ? chatListMapper.insert(chatList) : 1L;
//    }
//
//
//}
